﻿using System.ServiceModel;
using Silverlight.Training.Server.Common;
using Silverlight.Training.Server.Common.Contracts;
using Silverlight.Training.Server.Common.Feedbacks;

namespace Silverlight.Training.Server.Interfaces
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract(Namespace = ServiceConstants.ServiceNamespace, Name = "EMService")]
    public interface IEMService
    {
        #region Employee

        /// <summary>
        /// This method aims to get all employees from database
        /// </summary>
        /// <returns>
        /// A Feedback object containing all employees
        /// </returns>
        [OperationContract]
        CollectionFeedback<Employee> GetEmployeeCollection();

        /// <summary>
        /// This method aims to get detailed information of an employee based on its ID.
        /// </summary>
        /// <param name="employeeID">
        /// The ID of the desired employee
        /// </param>
        /// <returns>
        /// A Feedback object containing a full-info employee
        /// </returns>
        [OperationContract]
        SingleFeedback<Employee> GetSingleEmployee(int employeeID);

        /// <summary>
        /// This method aims to insert a new object into database
        /// </summary>
        /// <param name="data">
        /// The Employee object to be inserted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about 
        ///    - inserting result and 
        ///    - the ID of new object if success or -1
        /// </returns>
        [OperationContract]
        SingleFeedback<int> InsertEmployee(Employee data);

        /// <summary>
        /// This method aims to update an existing record in database
        /// </summary>
        /// <param name="data">
        /// The Employee object to be updated
        /// </param>
        /// <returns>
        /// A Feedback object containing information about updating result
        /// </returns>
        [OperationContract]
        Feedback UpdateEmployee(Employee data);

        /// <summary>
        /// This method aims to delete an existing record in database
        /// </summary>
        /// <param name="data">
        /// The Employee object to be deleted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about deleting result
        /// </returns>
        [OperationContract]
        Feedback DeleteEmployee(Employee data);

        #endregion

        #region Department

        /// <summary>
        /// This method aims to get all departments from database
        /// </summary>
        /// <returns>
        ///  A Feedback object containing all departments
        /// </returns>
        [OperationContract]
        CollectionFeedback<Department> GetDepartmentCollection();

        /// <summary>
        /// This method aims to get detailed information of an department based on its ID.
        /// </summary>
        /// <param name="deptID">
        /// The ID of the desired department
        /// </param>
        /// <returns>
        /// A Feedback object containing a full-info department
        /// </returns>
        [OperationContract]
        SingleFeedback<Department> GetSingleDepartment(int deptID);

        /// <summary>
        /// This method aims to insert a new object into database
        /// </summary>
        /// <param name="data">
        /// The Department object to be inserted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about 
        ///    - inserting result and 
        ///    - the ID of new object if success or -1
        /// </returns>
        [OperationContract]
        SingleFeedback<int> InsertDepartment(Department data);

        /// <summary>
        /// This method aims to update an existing record in database
        /// </summary>
        /// <param name="data">
        /// The Department object to be updated
        /// </param>
        /// <returns>
        /// A Feedback object containing information about updating result
        /// </returns>
        [OperationContract]
        Feedback UpdateDepartment(Department data);

        /// <summary>
        /// This method aims to delete an existing record in database
        /// </summary>
        /// <param name="data">
        /// The Department object to be deleted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about deleting result
        /// </returns>
        [OperationContract]
        Feedback DeleteDepartment(Department data);

        #endregion

        #region JobTitle

        /// <summary>
        /// This method aims to get all job titles from database
        /// </summary>
        /// <returns>
        ///  A Feedback object containing all job titles
        /// </returns>
        [OperationContract]
        CollectionFeedback<JobTitle> GetJobTitleCollection();

        /// <summary>
        /// This method aims to get detailed information of an job title based on its ID.
        /// </summary>
        /// <param name="jTitleID">
        /// The ID of the desired job title
        /// </param>
        /// <returns>
        /// A Feedback object containing a full-info job title
        /// </returns>
        [OperationContract]
        SingleFeedback<JobTitle> GetSingleJobTitle(int jTitleID);

        /// <summary>
        /// This method aims to insert a new object into database
        /// </summary>
        /// <param name="data">
        /// The JobTitle object to be inserted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about 
        ///    - inserting result and 
        ///    - the ID of new object if success or -1
        /// </returns>
        [OperationContract]
        SingleFeedback<int> InsertJobTitle(JobTitle data);

        /// <summary>
        /// This method aims to update an existing record in database
        /// </summary>
        /// <param name="data">
        /// The JobTitle object to be updated
        /// </param>
        /// <returns>
        /// A Feedback object containing information about updating result
        /// </returns>
        [OperationContract]
        Feedback UpdateJobTitle(JobTitle data);

        /// <summary>
        /// This method aims to delete an existing record in database
        /// </summary>
        /// <param name="data">
        /// The JobTitle object to be deleted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about deleting result
        /// </returns>
        [OperationContract]
        Feedback DeleteJobTitle(JobTitle data);

        #endregion

        #region EmployeeType

        /// <summary>
        /// This method aims to get all employee types from database
        /// </summary>
        /// <returns>
        ///  A Feedback object containing all employee types
        /// </returns>
        [OperationContract]
        CollectionFeedback<EmployeeType> GetEmployeeTypeCollection();

        /// <summary>
        /// This method aims to get detailed information of an employee type based on its ID.
        /// </summary>
        /// <param name="eTypeID">
        /// The ID of the desired employee type
        /// </param>
        /// <returns>
        /// A Feedback object containing a full-info employee type
        /// </returns>
        [OperationContract]
        SingleFeedback<EmployeeType> GetSingleEmployeeType(int eTypeID);

        /// <summary>
        /// This method aims to insert a new object into database
        /// </summary>
        /// <param name="data">
        /// The EmployeeType object to be inserted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about 
        ///    - inserting result and 
        ///    - the ID of new object if success or -1
        /// </returns>
        [OperationContract]
        SingleFeedback<int> InsertEmployeeType(EmployeeType data);

        /// <summary>
        /// This method aims to update an existing record in database
        /// </summary>
        /// <param name="data">
        /// The EmployeeType object to be updated
        /// </param>
        /// <returns>
        /// A Feedback object containing information about updating result
        /// </returns>
        [OperationContract]
        Feedback UpdateEmployeeType(EmployeeType data);

        /// <summary>
        /// This method aims to delete an existing record in database
        /// </summary>
        /// <param name="data">
        /// The EmployeeType object to be deleted
        /// </param>
        /// <returns>
        /// A Feedback object containing information about deleting result
        /// </returns>
        [OperationContract]
        Feedback DeleteEmployeeType(EmployeeType data);

        #endregion
    }
}
